package com.demo.config;

import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;

/**
 * @author 李天航
 */
@EnableWebSecurity
public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
    @Override
    protected void configure(HttpSecurity http) throws Exception{
        //只对/eureka/**放行
        // 访问eureka控制台和/actuator是的安全控制
        super.configure(http);
        //为所有/eureka/**的请求放行
        http.csrf().ignoringAntMatchers("/eureka/**");
    }
}
